package com.leoman.plz_p.module.api;


import com.leoman.plz_p.constants.Urls;
import com.leoman.plz_p.module.bean.BaseData;
import com.leoman.plz_p.module.bean.MapData;
import com.leoman.plz_p.module.bean.UploadCallBackBean;

import cn.com.corelib.api.RequestBodyCreator;
import okhttp3.RequestBody;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;
import rx.Observable;

/**
 * Created by guoh on 2018/7/15.
 */
public interface UserApi {

    @POST(Urls.EDIT_USER)
    Observable<BaseData> editUser(@Query("token") String token, @Query("headimg") String headimg, @Query("nickname") String nickname, @Query("address") String address, @Query("addressName") String addressName, @Query("identity") String identity, @Query("phone") String phone);

    @Multipart
    @POST(Urls.UPLOAD_IMAGE)
    Observable<BaseData<MapData<UploadCallBackBean>>> uploadImage(@Part("token") RequestBody token,
                                                                  @Part("files" + RequestBodyCreator.MULTIPART_HACK) RequestBody avatar);

    @POST(Urls.RESET_PASSWORD)
    Observable<BaseData<MapData>> resetPassword(@Query("studentId") String studentId, @Query("oldPassword") String oldPassword, @Query("newPassword") String newPassword);
}
